<template>
	<view>
		<!-- <basics v-if="PageCur=='basics'"></basics>
		<components v-if="PageCur=='component'"></components>
		<plugin v-if="PageCur=='plugin'"></plugin> -->
		<char v-if="PageCur == 'char'" ref="char"></char>
		<mail v-if="PageCur == 'mail'"></mail>
		<view class="cu-bar tabbar bg-white shadow foot">
			<view class="action" @click="NavChange" data-cur="char">
				<view class='cuIcon-cu-image'>
					<image :src="'/static/tabbar/basics' + [PageCur=='char'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='char'?'text-green':'text-gray'">聊天</view>
			</view>
			<view class="action" @click="NavChange" data-cur="mail">
				<view class='cuIcon-cu-image'>
					<image :src="'/static/tabbar/component' + [PageCur == 'mail'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='mail'?'text-green':'text-gray'">通讯录</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
		return {
				PageCur: 'char'
			}
		},
		onLoad() {
			this.showPage()
		},
		methods: {
			NavChange: function(e) {
				this.PageCur = e.currentTarget.dataset.cur
				this.showPage()
			},
			showPage(){
				if(this.PageCur == 'char'){
					this.$nextTick(() => {
						this.$refs.char.show()
					});
				}
			}
		}
	}
</script>

<style>

</style>
